#pragma comment(linker,"/STACK:100000000")
#include "testlib.h"
#include <stdio.h>
#define N 1010
char u[N][N];
int main()
{
	registerValidation();
	int n, k, i, j;
	n=inf.readInt(1, 1000, "n"); inf.readSpace();
	k=inf.readInt(0, 100000, "k"); inf.readEoln();
	for(; k--; )
	{
		i=inf.readInt(1, n, "a_i"); inf.readSpace();
		j=inf.readInt(1, n, "b_i"); inf.readEoln();
		ensuref(!u[i][j], "multiple edges are not allowed");
		u[i][j]=1;
	}
	inf.readEof();
	return 0;
}